﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
using WorkflowEngine.Entitys;
using WorkflowEngine.IRepositorys;

namespace WorkflowEngine.Managers
{
    public interface IWorkflowInstanceManager
    {
        Task<IQueryable<WorkflowInstance>> Query(bool includeDetails = false);
    }
    public class WorkflowInstanceManager:DomainService, IWorkflowInstanceManager
    {
        protected IWorkflowInstanceRespository _workflowInstanceRespository;

        public WorkflowInstanceManager(IWorkflowInstanceRespository workflowInstanceRespository)
        {
            _workflowInstanceRespository = workflowInstanceRespository;
        }
        public  async  Task<IQueryable<WorkflowInstance>> Query(bool includeDetails = false)
        {
            var query=  await  _workflowInstanceRespository.GetQueryableAsync(includeDetails);
            return query;
        }
    }
}
